﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using HtmlAgilityPack;
using System.Collections.Generic;

/// <summary>
/// Summary description for Airplane
/// </summary>
/// 
enum LoaiTimKiem
{
    OneWay,
    RoundTrip
};
public class Airplane
{
    static public List<thongtincb> lInfo = new List<thongtincb>();
    static public List<thongtincb> lKhuHoi = new List<thongtincb>();
    HtmlAgilityPack.HtmlDocument _document;

    public HtmlAgilityPack.HtmlDocument Document
    {
        get { return _document; }
        set { _document = value; }
    }

    
    string _loaiTimKiem;

    public string LoaiTK
    {
        get { return _loaiTimKiem; }
        set { _loaiTimKiem = value; }
    }
    string _diemDi;

    public string DiemDi
    {
        get { return _diemDi; }
        set { _diemDi = value; }
    }
    string _diemDen;

    public string DiemDen
    {
        get { return _diemDen; }
        set { _diemDen = value; }
    }
    string _ngayDi;

    public string NgayDi
    {
        get { return _ngayDi; }
        set { _ngayDi = value; }
    }
    string _ngayVe;

    public string NgayVe
    {
        get { return _ngayVe; }
        set { _ngayVe = value; }
    }
    string _thangDi;

    public string ThangDi
    {
        get { return _thangDi; }
        set { _thangDi = value; }
    }
    string _thangVe;

    public string ThangVe
    {
        get { return _thangVe; }
        set { _thangVe = value; }
    }
    public void init(string loai, string diemDi, string ngayDi, string thangDi, string diemDen, string ngayVe, string thangVe)
    {
        LoaiTK = loai;
        DiemDi = diemDi;
        NgayDi = ngayDi;
        ThangDi = thangDi;
        DiemDen = diemDen;
        NgayVe = ngayVe;
        ThangVe = thangVe;
        _document = new HtmlAgilityPack.HtmlDocument();
    }
    public void InitDiaDiem()
    {
        string temp = "";
        for (int i = DiemDi.Length - 4; i < DiemDi.Length - 1; i++)
        {
            temp += DiemDi[i];
        }
        DiemDi = temp;

        temp = "";
        for (int i = DiemDen.Length - 4; i < DiemDen.Length - 1; i++)
        {
            temp += DiemDen[i];
        }
        DiemDen = temp;
    }
    public Airplane()
    {
        //
        // TODO: Add constructor logic here
        //
    }
}
